package com.logistics.socket.model;

import com.logistics.utils.tool.DateUtils;
import com.logistics.utils.tool.StringUtils;
import lombok.Data;

import java.math.BigDecimal;

@Data
public class RequestValueModel {

    private String taskname;

    private String task_type;

    private Integer index;

    private Integer priority;

    private Integer focaldistance;

    private String deviceid;

    private String device_type;

    private String getlocation;

    private String putlocation;

    private Integer loadheight;

    private Integer unloadheight;

    private Integer containheight;

    private Integer conupheight;

    private Integer emptyheight;

    private Integer empdownheight;

    private String qualitynodes;

    private String deslocation;

    private Integer lastheight;

    private Integer runheight;

    private Boolean imm;

    public RequestValueModel(){}


    /**
     * 点到点配送
     * @param deviceId
     * @param deslocation
     * @return
     */
    public static RequestValueModel pointToPoint(String deviceId, String deslocation){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("pointToPointTask" + DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setTask_type("F02");
//        requestValueModel.setDeviceid(deviceId);
        requestValueModel.setDeslocation(deslocation);
        requestValueModel.setLastheight(0);
        requestValueModel.setRunheight(0);
        return requestValueModel;
    }



    public static RequestValueModel delivery(String deviceId, String startStation, String endStation){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("deliveryTask" + DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setTask_type("F01");
//        requestValueModel.setDeviceid(deviceId);
        requestValueModel.setPriority(1);
        requestValueModel.setFocaldistance(0);
        requestValueModel.setGetlocation(startStation);
        requestValueModel.setPutlocation(endStation);
        requestValueModel.setLoadheight(200);
        requestValueModel.setUnloadheight(0);
        requestValueModel.setContainheight(0);
        requestValueModel.setConupheight(200);
        requestValueModel.setEmptyheight(200);
        requestValueModel.setEmpdownheight(0);
        return requestValueModel;
    }


    /**
     * 空托呼叫
     * @param startStation
     * @param endStation
     * @param loadHeight
     * @param containHeight
     * @return
     */
    public static RequestValueModel containerCall(String startStation, String endStation, BigDecimal loadHeight, BigDecimal containHeight){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("containerCall"+ DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setTask_type("F01");
        requestValueModel.setPriority(1);
        requestValueModel.setFocaldistance(0);
        requestValueModel.setGetlocation(startStation);
        requestValueModel.setPutlocation(endStation);
        requestValueModel.setLoadheight(200);
        requestValueModel.setUnloadheight(0);
        requestValueModel.setContainheight(loadHeight.intValue());
        requestValueModel.setConupheight(containHeight.intValue());
        requestValueModel.setEmptyheight(200);
        requestValueModel.setEmpdownheight(0);
        return requestValueModel;
    }

    /**
     * 托盘回收
     * @param deviceId
     * @param startStation
     * @param endStation
     * @param conupheight
     * @param empdownheight
     * @return
     */
    public static RequestValueModel containerRecovery(String deviceId, String startStation, String
            endStation, BigDecimal conupheight, BigDecimal empdownheight){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("containerRecovery" + DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setTask_type("F01");
//        requestValueModel.setDeviceid(deviceId);
        requestValueModel.setPriority(1);
        requestValueModel.setFocaldistance(0);
        requestValueModel.setGetlocation(startStation);
        requestValueModel.setPutlocation(endStation);
        requestValueModel.setLoadheight(200);
        requestValueModel.setUnloadheight(0);
        requestValueModel.setContainheight(0);
        requestValueModel.setConupheight(200);
        requestValueModel.setEmptyheight(conupheight.intValue());
        requestValueModel.setEmpdownheight(empdownheight.intValue());
        return requestValueModel;
    }

    /**
     * 托盘放置
     * @param deviceId
     * @param location
     * @return
     */
    public static RequestValueModel placeTask(String deviceId, String location){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("placeTask" + DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setPutlocation(location);
        requestValueModel.setTask_type("F05");
        requestValueModel.setImm(true);
        requestValueModel.setDeviceid(deviceId);
        requestValueModel.setLoadheight(200);
        requestValueModel.setEmptyheight(150);
        requestValueModel.setEmpdownheight(0);
        return  requestValueModel;
    }

    /**
     * 托盘搭载
     * @param deviceId
     * @param location
     * @return
     */
    public static RequestValueModel containerCarrying(String deviceId, String location){
        RequestValueModel requestValueModel = new RequestValueModel();
        requestValueModel.setTaskname("ContainerCarrying" + DateUtils.getYYMMDDHHMMSS());
        requestValueModel.setIndex(1);
        requestValueModel.setGetlocation(location);
        requestValueModel.setTask_type("F04");
        requestValueModel.setImm(true);
        requestValueModel.setDeviceid(deviceId);
        requestValueModel.setLoadheight(200);
        requestValueModel.setConupheight(200);
        requestValueModel.setContainheight(0);
        return  requestValueModel;
    }
}
